package com.amos.muexamclient.sys.mapper;

import com.amos.muexamclient.sys.entity.SysMenuEntity;
import com.amos.muexamclient.sys.service.dto.SysMenuDTO;
import com.amos.muexamcore.core.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;


/**
 * Copyright © 2018 五月工作室. All rights reserved.
 *
 * @Package com.amos.muexamclient.sys.mapper
 * @ClassName SysMenuDao
 * @Description TODO
 * @Author Amos
 * @Modifier
 * @Date 2020-03-24 14:35:22
 * @Version 1.0
 **/
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenuEntity, SysMenuDTO> {

    /**
     * 根据用户id查询菜单权限信息
     *
     * @param id
     * @return
     */
    Set<String> selectMenuPermsByUserId(@Param("userId") String id);

    List<SysMenuDTO> selectMenuTreeAll();

    List<SysMenuDTO> selectMenuTreeByUserId(@Param("userId") String id);

    List<SysMenuDTO> selectMenuList(@Param("record") SysMenuDTO dto);

    List<SysMenuDTO> selectMenuListByUserId(@Param("record") SysMenuDTO dto);

    List<String> selectMenuListByRoleId(@Param("roleId") String roleId);

    List<SysMenuDTO> getByMenuNameAndParent(@Param("menuName") String menuName, @Param("parentId") String parentId);

    int hasChildByMenuId(@Param("menuId") String id);
}